<?php
	//No direct access
	defined('_JEXEC') or die('Restricted access');

	$acl = & JFactory::getACL();

	// transaction
	$acl->addACL('transaction','manage','users','Branch Staff');
	$acl->addACL('transaction','manage','users','Transferred Staff');
	$acl->addACL('transaction','manage','users','Branch Manager');
	$acl->addACL('transaction','manage','users','Centre Manager');
	$acl->addACL('transaction','manage','users','MD');

	// action transaction
	$acl->addACL( 'transaction', 'view', 'users', 'Member', 'transaction', 'own');
	$acl->addACL( 'transaction', 'view', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'view', 'users', 'Transferred Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'view', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'view', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'view', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'edit', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'edit', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'edit', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'edit', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'add', 'users', 'Member', 'transaction', 'own');
	$acl->addACL( 'transaction', 'add', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'add', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'add', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'add', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'delete', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'delete', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'approval', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'approval', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'approval', 'users', 'MD', 'transaction', 'all');

	//$acl->addACL( 'transaction', 'approve', 'users', 'Centre Manager', 'transaction', 'all');
	//$acl->addACL( 'transaction', 'approve', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'transfer', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'transfer', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'transferred', 'users', 'Transferred Staff', 'transaction', 'all');
	
	#history
	$acl->addACL('history','manage','users','Transferred Staff');

	#change status action
	$acl->addACL( 'transaction', 'changestatus', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'changestatus', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'changestatus', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'changestatus', 'users', 'MD', 'transaction', 'all');

	$acl->addACL( 'transaction', 'failed', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'cancelled', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'failed', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'cancelled', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'failed', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'cancelled', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'failed', 'users', 'MD', 'transaction', 'all');
	$acl->addACL( 'transaction', 'cancelled', 'users', 'MD', 'transaction', 'all');

	#customer transfers
	$acl->addACL( 'transaction', 'customer', 'users', 'Branch Staff', 'transaction', 'all');
	$acl->addACL( 'transaction', 'customer', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'customer', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'customer', 'users', 'MD', 'transaction', 'all');
	
	$acl->addACL( 'transaction', 'corrected', 'users', 'Branch Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'corrected', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'corrected', 'users', 'MD', 'transaction', 'all');

	// transferring  transactions
	$acl->addACL( 'transaction', 'transferring', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'transferring', 'users', 'MD', 'transaction', 'all');

	// transactions all
	$acl->addACL( 'transaction', 'transactionall', 'users', 'Centre Manager', 'transaction', 'all');
	$acl->addACL( 'transaction', 'transactionall', 'users', 'MD', 'transaction', 'all');

	// reveiver account
	$acl->addACL('account','manage','users','Branch Staff');
	$acl->addACL('account','manage','users','Branch Manager');
	$acl->addACL('account','manage','users','Centre Manager');
	$acl->addACL('account','manage','users','MD');

	// action reveiver account
	$acl->addACL( 'account', 'view', 'users', 'Branch Staff', 'account', 'all');
	$acl->addACL( 'account', 'view', 'users', 'Branch Manager', 'account', 'all');
	$acl->addACL( 'account', 'view', 'users', 'Centre Manager', 'account', 'all');
	$acl->addACL( 'account', 'view', 'users', 'MD', 'account', 'all');

	$acl->addACL( 'account', 'edit', 'users', 'Branch Staff', 'account', 'all');
	$acl->addACL( 'account', 'edit', 'users', 'Branch Manager', 'account', 'all');
	$acl->addACL( 'account', 'edit', 'users', 'Centre Manager', 'account', 'all');
	$acl->addACL( 'account', 'edit', 'users', 'MD', 'account', 'all');

	$acl->addACL( 'account', 'add', 'users', 'Branch Staff', 'account', 'all');
	$acl->addACL( 'account', 'add', 'users', 'Branch Manager', 'account', 'all');
	$acl->addACL( 'account', 'add', 'users', 'Centre Manager', 'account', 'all');
	$acl->addACL( 'account', 'add', 'users', 'MD', 'account', 'all');

	$acl->addACL( 'account', 'delete', 'users', 'Branch Staff', 'account', 'all');
	$acl->addACL( 'account', 'delete', 'users', 'Branch Manager', 'account', 'all');
	$acl->addACL( 'account', 'delete', 'users', 'Centre Manager', 'account', 'all');
	$acl->addACL( 'account', 'delete', 'users', 'MD', 'account', 'all');

	//member
	$acl->addACL('member','manage','users','Branch Staff');
	$acl->addACL('member','manage','users','Branch Manager');
	$acl->addACL('member','manage','users','Centre Manager');
	$acl->addACL('member','manage','users','MD');

	// action member
	$acl->addACL( 'member', 'view', 'users', 'Member', 'member', 'own');
	$acl->addACL( 'member', 'view', 'users', 'Branch Staff', 'member', 'all');
	$acl->addACL( 'member', 'view', 'users', 'Branch Manager', 'member', 'all');
	$acl->addACL( 'member', 'view', 'users', 'Centre Manager', 'member', 'all');
	$acl->addACL( 'member', 'view', 'users', 'MD', 'member', 'all');

	//member add
	$acl->addACL( 'member', 'add', 'users', 'Branch Staff', 'member', 'all');
	$acl->addACL( 'member', 'add', 'users', 'Branch Manager', 'member', 'all');
	$acl->addACL( 'member', 'add', 'users', 'Centre Manager', 'member', 'all');
	$acl->addACL( 'member', 'add', 'users', 'MD', 'member', 'all');

	//member edit
	$acl->addACL( 'member', 'edit', 'users', 'Branch Staff', 'member', 'all');
	$acl->addACL( 'member', 'edit', 'users', 'Branch Manager', 'member', 'all');
	$acl->addACL( 'member', 'edit', 'users', 'Centre Manager', 'member', 'all');
	$acl->addACL( 'member', 'edit', 'users', 'MD', 'member', 'all');

	//member download
	$acl->addACL( 'member', 'download', 'users', 'Branch Staff', 'member', 'all' );
	$acl->addACL( 'member', 'download', 'users', 'Branch Manager', 'member', 'all' );
	$acl->addACL( 'member', 'download', 'users', 'Centre Manager', 'member', 'all' );
	$acl->addACL( 'member', 'download', 'users', 'MD', 'member', 'all' );

	//member delete
	$acl->addACL( 'member', 'delete', 'users', 'MD', 'member', 'all');

	//member import and export
	$acl->addACL( 'member', 'import', 'users', 'MD', 'member', 'all');
	$acl->addACL( 'member', 'export', 'users', 'MD', 'member', 'all');

	//member change group
	$acl->addACL( 'member', 'changegroup', 'users', 'Centre Manager', 'member', 'all' );
	$acl->addACL( 'member', 'changegroup', 'users', 'MD', 'member', 'all' );

	//user manage
	$acl->addACL('user','manage','users','Branch Manager');
	$acl->addACL('user','manage','users','Centre Manager');
	$acl->addACL('user','manage','users','MD');

	//action user
	$acl->addACL( 'user', 'add', 'users', 'Branch Manager', 'user', 'all');
	$acl->addACL( 'user', 'add', 'users', 'Centre Manager', 'user', 'all');
	$acl->addACL( 'user', 'add', 'users', 'MD', 'user', 'all');

	//user view
	$acl->addACL( 'user', 'view', 'users', 'Branch Manager', 'user', 'all');
	$acl->addACL( 'user', 'view', 'users', 'Centre Manager', 'user', 'all');
	$acl->addACL( 'user', 'view', 'users', 'MD', 'user', 'all');

	//user edit
	$acl->addACL( 'user', 'edit', 'users', 'Branch Manager', 'user', 'all');
	$acl->addACL( 'user', 'edit', 'users', 'Centre Manager', 'user', 'all');
	$acl->addACL( 'user', 'edit', 'users', 'MD', 'user', 'all');
	
	//user download
	$acl->addACL( 'user', 'download', 'users', 'MD', 'user', 'all' );
	
	//user delete
	$acl->addACL( 'user', 'delete', 'users', 'Branch Manager', 'user', 'all');
	$acl->addACL( 'user', 'delete', 'users', 'Centre Manager', 'user', 'all');
	$acl->addACL( 'user', 'delete', 'users', 'MD', 'user', 'all');

	//user change group
	$acl->addACL( 'user', 'changebranch', 'users', 'Centre Manager', 'user', 'all' );
	$acl->addACL( 'user', 'changebranch', 'users', 'MD', 'user', 'all' );

	// show exchange rate
	$acl->addACL( 'showexchangerate', 'view', 'users', 'Member', 'showexchangerate', 'all');
	$acl->addACL( 'showexchangerate', 'view', 'users', 'Branch Staff', 'showexchangerate', 'all');
	$acl->addACL( 'showexchangerate', 'view', 'users', 'Branch Manager', 'showexchangerate', 'all');
	$acl->addACL( 'showexchangerate', 'view', 'users', 'Centre Manager', 'showexchangerate', 'all');
	$acl->addACL( 'showexchangerate', 'view', 'users', 'MD', 'showexchangerate', 'all');
	
	// exchange rate
	//$acl->addACL('exchangerate','manage','users','Branch Manager');
	$acl->addACL('exchangerate','manage','users','Centre Manager');
	$acl->addACL('exchangerate','manage','users','MD');

	// action rate
	//$acl->addACL( 'exchangerate', 'view', 'users', 'Branch Manager', 'exchangerate', 'all');
	$acl->addACL( 'exchangerate', 'view', 'users', 'Centre Manager', 'exchangerate', 'all');
	$acl->addACL( 'exchangerate', 'view', 'users', 'MD', 'exchangerate', 'all');

	$acl->addACL( 'exchangerate', 'add', 'users', 'MD', 'exchangerate', 'all');

	//$acl->addACL( 'exchangerate', 'edit', 'users', 'Branch Manager', 'exchangerate', 'all');
	$acl->addACL( 'exchangerate', 'edit', 'users', 'Centre Manager', 'exchangerate', 'all');
	$acl->addACL( 'exchangerate', 'edit', 'users', 'MD', 'exchangerate', 'all');

	$acl->addACL( 'exchangerate', 'delete', 'users', 'MD', 'exchangerate', 'all');
	
	//currency
	$acl->addACL('currency','manage','users','Centre Manager');
	$acl->addACL('currency','manage','users','MD');
	
	// action rate
	$acl->addACL( 'currency', 'view', 'users', 'Centre Manager', 'currency', 'all');
	$acl->addACL( 'currency', 'view', 'users', 'MD', 'currency', 'all');
	$acl->addACL( 'currency', 'add', 'users', 'Centre Manager', 'currency', 'all');
	$acl->addACL( 'currency', 'add', 'users', 'MD', 'currency', 'all');
	$acl->addACL( 'currency', 'edit', 'users', 'Centre Manager', 'currency', 'all');
	$acl->addACL( 'currency', 'edit', 'users', 'MD', 'currency', 'all');
	$acl->addACL( 'currency', 'delete', 'users', 'Centre Manager', 'currency', 'all');
	$acl->addACL( 'currency', 'delete', 'users', 'MD', 'currency', 'all');

	// branch
	$acl->addACL('branch','manage','users','MD');
 
	// action branch
	$acl->addACL( 'branch', 'view', 'users', 'MD', 'branch', 'all');
	$acl->addACL( 'branch', 'add', 'users', 'MD', 'branch', 'all');
	$acl->addACL( 'branch', 'edit', 'users', 'MD', 'branch', 'all');
	$acl->addACL( 'branch', 'delete', 'users', 'MD', 'branch', 'all');

	// report
	$acl->addACL('report','manage','users','Centre Manager');
	$acl->addACL('report','manage','users','MD');

	//action report
	$acl->addACL( 'report', 'view', 'users', 'Centre Manager', 'report', 'all');
	$acl->addACL( 'report', 'download', 'users', 'Centre Manager', 'report', 'all');
	$acl->addACL( 'report', 'view', 'users', 'MD', 'report', 'all');
	$acl->addACL( 'report', 'download', 'users', 'MD', 'report', 'all');

	// fee
	$acl->addACL('fee', 'manage', 'users', 'Centre Manager');
	$acl->addACL('fee', 'manage', 'users', 'MD');

	// action fee
	$acl->addACL( 'fee', 'add', 'users', 'Centre Manager', 'fee', 'all');
	$acl->addACL( 'fee', 'edit', 'users', 'Centre Manager', 'fee', 'all');
	$acl->addACL( 'fee', 'delete', 'users', 'Centre Manager', 'fee', 'all');
	$acl->addACL( 'fee', 'add', 'users', 'MD', 'fee', 'all');
	$acl->addACL( 'fee', 'edit', 'users', 'MD', 'fee', 'all');
	$acl->addACL( 'fee', 'delete', 'users', 'MD', 'fee', 'all');

	// setting
	$acl->addACL('setting','manage','users','Centre Manager');
	$acl->addACL('setting','manage','users','MD');

	// action setting
	$acl->addACL( 'setting', 'edit', 'users', 'Centre Manager', 'setting', 'all');
	$acl->addACL( 'setting', 'edit', 'users', 'MD', 'setting', 'all');

	//print report
	$acl->addACL('printreport','manage','users','Branch Manager');

	// Level
	$acl->addACL('vip', 'manage', 'users', 'MD');

	// Point
	$acl->addACL('point', 'manage', 'users', 'MD');
?>